package com.qyhl.webtv.module_live.teletext.list;


import com.qyhl.webtv.commonlib.entity.live.LiveRoomBean;

import java.util.List;

/**
 * Created by qyhl2 on 2017/12/12.
 *
 * @author helin
 */

public class LivesListPresenter implements LivesListContract.LiveListPresenter {


    private final LivesListContract.LiveListView view;
    private final LiveListModel model;

    LivesListPresenter(LivesListContract.LiveListView view) {
        this.view = view;
        this.model = new LiveListModel(this);

    }


    @Override
    public void error(String message, boolean isMore) {
        view.error(message, isMore);
    }

    @Override
    public void success(List<LiveRoomBean> response, boolean isMore) {
        if (response == null || response.size() == 0) {
            view.empty(isMore);
        }else{
            view.success(response, isMore);
        }
    }

    @Override
    public void getLiveList(String liveId, String liveType) {
        model.getLiveList(liveId, liveType);
    }
}
